PER.rover
Class TakePanoramaAction

java.lang.Object
  extended byPER.rover.TakePanoramaAction
All Implemented Interfaces:
Action, java.io.Serializable

public class TakePanoramaAction
extends java.lang.Object
implements Action

Takes panoramic images.

See Also:
Serialized Form

Field Summary
static int FOV_HEIGHT
           
static int FOV_WIDTH
           
 
Constructor Summary
TakePanoramaAction()
          Creates new TakePanoramaAction from angles -50 to 0 at 320x240
TakePanoramaAction(int lowAng, int highAng, int width, int height)
          Creates a new TakePanoramaAction with options for the tilt angle and image size.
 
Method Summary
 boolean doAction(Rover r)
          Takes a panorama.
 java.awt.image.BufferedImage getImage()
          Returns the panoramic image taken by the action.
 long getImageUpdateTime()
          Lets you know when the last image was taken by this action.
 java.awt.image.BufferedImage getRecentImage()
          Returns the most recent image taken by this Action.
 int getReturnValue()
          The return value of the Action.
 java.lang.String getShortSummary()
          Provides a shortened version of the summary returned by getSummary.
 java.lang.String getSummary()
          Provides a textual explanation of the Action, such as "turn 90 degrees"
 int getTime()
          How long the action will take, in milliseconds.
 int getTimeRemaining()
          How much time until the action finishes (in milliseconds), if it has already started.
 long ImagesDone()
           
 boolean isCompleted()
          Whether the action has completed.
 boolean isSuccess()
          Whether the action completed successfully.
 void kill()
          Emergency stop - end the action immediately, if it's running.
 long lastTimeImageUpdated()
          Returns the time (in ms) when the panoramic image was last updated with a new picture from the rover.
 boolean setAngles(int lowAng, int highAng)
          Sets the low and high angles to be used for the panorama.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOV_WIDTH

public static final int FOV_WIDTH
See Also:
Constant Field Values

FOV_HEIGHT

public static final int FOV_HEIGHT
See Also:
Constant Field Values
Constructor Detail

TakePanoramaAction

public TakePanoramaAction()
Creates new TakePanoramaAction from angles -50 to 0 at 320x240


TakePanoramaAction

public TakePanoramaAction(int lowAng,
                          int highAng,
                          int width,
                          int height)
Creates a new TakePanoramaAction with options for the tilt angle and image size.

Parameters:
lowAng - The minimum tilt angle that the picture includes.
highAng - The maximum tilt angle that the picture includes.
width - The width in pixels of the target image.
height - The height in pixels of the target image.
Method Detail

setAngles

public boolean setAngles(int lowAng,
                         int highAng)
Sets the low and high angles to be used for the panorama.

Returns:
False if the low angle is not less that the high angle.

getImage

public java.awt.image.BufferedImage getImage()
Returns the panoramic image taken by the action. May be null if the image has not yet been taken.

This method is included for backwards compatibility. getRecentImage performs the same function.

See Also:
getRecentImage()

isSuccess

public boolean isSuccess()
Description copied from interface: Action
Whether the action completed successfully. Undefined until isCompleted() returns true.

Specified by:
isSuccess in interface Action

doAction

public boolean doAction(Rover r)
Takes a panorama.

Specified by:
doAction in interface Action

getSummary

public java.lang.String getSummary()
Description copied from interface: Action
Provides a textual explanation of the Action, such as "turn 90 degrees"

Specified by:
getSummary in interface Action

getReturnValue

public int getReturnValue()
Description copied from interface: Action
The return value of the Action. Zero is a success. Negative implies one of this class's constants. Other values should be interpreted as appropriate.

Specified by:
getReturnValue in interface Action
See Also:
RoverState, ActionConstants

getTime

public int getTime()
Description copied from interface: Action
How long the action will take, in milliseconds.

Specified by:
getTime in interface Action

getShortSummary

public java.lang.String getShortSummary()
Description copied from interface: Action
Provides a shortened version of the summary returned by getSummary. For example, getSummary may return something like "Turn left and drive about 39 inches toward the red landmark," whereas getShortSummary might just return "Drive toward a landmark."

Specified by:
getShortSummary in interface Action

isCompleted

public boolean isCompleted()
Description copied from interface: Action
Whether the action has completed. Undefined until doAction has been called.

Specified by:
isCompleted in interface Action

kill

public void kill()
Description copied from interface: Action
Emergency stop - end the action immediately, if it's running.

Specified by:
kill in interface Action

getTimeRemaining

public int getTimeRemaining()
Description copied from interface: Action
How much time until the action finishes (in milliseconds), if it has already started. Undefined behavior if the action has not yet begun, or has finished.

Specified by:
getTimeRemaining in interface Action

lastTimeImageUpdated

public long lastTimeImageUpdated()
Returns the time (in ms) when the panoramic image was last updated with a new picture from the rover.

This method is here for backwards compatibility. New programs should use getImageUpdateTime.

See Also:
getImageUpdateTime()

ImagesDone

public long ImagesDone()

getImageUpdateTime

public long getImageUpdateTime()
Description copied from interface: Action
Lets you know when the last image was taken by this action. If the Action does not take pictures or the first picture has not yet been taken, will return 0.

Specified by:
getImageUpdateTime in interface Action
Returns:
the system time in milliseconds when the last image was taken or 0 if no images have been taken

getRecentImage

public java.awt.image.BufferedImage getRecentImage()
Description copied from interface: Action
Returns the most recent image taken by this Action. The image will be null if the Action does not take pictures or the first picture has not yet been taken.

Specified by:
getRecentImage in interface Action
Returns:
the most recent picture taken by the Action.